chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {

    sendResponse({ yourEvent: "正在调整, 需要时间生效" });
    xC = request.x;
    yC = request.y;

    if (request.mouse === "D") {
        console.log("......service-worker 鼠标按下......");
        chrome.debugger.sendCommand({ tabId: sender.tab.id }, "Input.dispatchMouseEvent", { type: "mousePressed", x: xC, y: yC, button: "left", clickCount: 1 }, function (e) {
            console.log('clickDown')
            console.log(e)
        });

    } else if (request.mouse === "U") {
        console.log(".......service-worker 鼠标弹起.......");
        chrome.debugger.sendCommand({ tabId: sender.tab.id }, "Input.dispatchMouseEvent", { type: "mouseReleased", x: xC, y: yC, button: "left", clickCount: 1 }, function (e) {
            console.log('clickUp')
            console.log(e)
        });

    }
})